<!--#Include File="../Inc/Const.Asp" -->
<%
Call ChkLogin("login")
Dim uploadInput
uploadInput = Request("input")
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
* { font-size:13px; }
body { background-color: #F3FAEB; margin: 0px; padding: 0px; }
.inputsub { font-size: 10px; margin: 0px; line-height: 80%; padding-top: 3px; }
-->
</style>
<script>
function addUploadItem(type,path,path2){

if (type=='gif'||type=='jpg'||type=='jpeg'||type=='jpe'||type=='bmp'||type=='png' || type=='doc' || type=='xls' || type=='pdf') {

<%
if Len(uploadInput)=0 then
%>
parent.document.getElementById('indexpicimg').innerHTML='<img src=' + path + ' height=95 width=150 />';
parent.document.getElementById("oIndexpic").value=path;
<%else%>
parent.document.getElementById("<%=uploadInput%>").value=path;
<%end if%>
}

}
</script>
</head>
<body>
<%
IF Request.QueryString("Act")="Upload" Then
	Dim sSavePath : sSavePath = Installdir & "uploadfile/" & Year(Now) & Right("0"&Month(Now),2) & "/" & Day(Now) & "/" : Call CreateFolder(sSavePath & "index.html")
	Dim UpFile
	set UpFile = New UpLoadClass
	UpFile.AutoSave = 2
	UpFile.MaxSize =  Int(getLogin("admin", "uploadfilesize") * 1024) '# (1024*1024=1M) SESSION��ĵ�λΪKB
	UpFile.FileType = getLogin("admin", "uploadfileexts")
	UpFile.SavePath = sSavePath
	UpFile.Open() '# �򿪶���
	If UpFile.Save("File",0) Then
		Call Insertuploadfile(sSavePath & UpFile.Form("File"))
		Response.write "<script>addUploadItem('" & LCase(UpFile.Form("File_Ext")) &"','" & sSavePath & UpFile.Form("File") & "','" & Replace(sSavePath & UpFile.Form("File"),"/uploadfile/","/") & "')</script>"
		Response.Write "<div style=""padding:6px""><a href='Uploadspic.Asp?input="&uploadInput&"'>�ļ��ϴ��ɹ����뷵�ؼ����ϴ�</a></div>"
	Else
		Select Case UpFile.Form("File_Err")
		Case -1 : Response.Write "<div style=""padding:6px""><a href='Uploadspic.Asp?input="&uploadInput&"'>û���ļ��ϴ����뷵�������ϴ�</a></div>"
		Case 1 : Response.Write "<div style=""padding:6px""><a href='Uploadspic.Asp?input="&uploadInput&"'>�ļ���С�������ƣ��뷵�������ϴ�</a></div>"
		Case 2 : Response.Write "<div style=""padding:6px""><a href='Uploadspic.Asp?input="&uploadInput&"'>�������ϴ����ļ����ͣ��뷵�������ϴ�</a></div>"
		Case 3 : Response.Write "<div style=""padding:6px""><a href='Uploadspic.Asp?input="&uploadInput&"'>�ļ���С�������Ʋ����ǲ������ϴ����ļ����ͣ��뷵�������ϴ�</a></div>"
		Case Else : Response.Write "<div style=""padding:6px""><a href='Uploadspic.Asp?input="&uploadInput&"'>δ֪�����뷵�������ϴ�</a></div>"
		End Select
	End If
	Set UpFile = Nothing	
Else
	Response.Write("<form name=""frm"" enctype=""multipart/form-data"" method=""post"" action=""Uploadspic.Asp?Act=Upload&input="&uploadInput&"""><input name=""File"" type=""File"" size=""39"" style=""font-size:12px;border-width:1px"">&nbsp;<input type=""Submit"" name=""Submit"" value="" �� �� "" class=""inputsub""></form>")
End IF
%>